from BlogApp.models import *
from django.shortcuts import render_to_response

def blogpage(request):
	
	posts = Post.objects.all().order_by("-created")
	sites = Sites.objects.all()
	aboutme = AboutMe.objects.all()
	categories = Category.objects.all()
	closeblog = TurnOff.objects.all()
	slogans = Slogan.objects.all()
	return render_to_response('blog.html', locals())
	
def aboutme(request):
	
	aboutme = AboutMe.objects.all()
	sites = Sites.objects.all()
	categories = Category.objects.all()
	slogans = Slogan.objects.all()
	closeblog = TurnOff.objects.all()
	return render_to_response('aboutme.html', locals())

	
def posts(request):
	#aboutme = AboutMe.objects.all()
	#post = Post.objects.get(Post.category.category_title == cat_title)
	return render_to_response('category.html', locals())
	
def Setting(request):
	return render_to_response('settings.html', locals())
	

	
